package com.biboheart.adapter.express.support;

import com.biboheart.adapter.express.actuator.GenericActuator;
import com.biboheart.adapter.support.utils.ObjectTypeUtils;

final class WhenActuator implements GenericActuator {
    @Override
    public Object execute(Object source, Object... args) {
        if (null == source || args.length == 0) {
            return null;
        }
        Boolean b = ObjectTypeUtils.convertType(source, Boolean.class);
        return b ? args[0] : null;
    }
}
